const jsdom = require("jsdom");
const { JSDOM } = jsdom;

const dom = new JSDOM('<!DOCUMENT html><p>hello world</p>')
const window = dom.window

window.XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest

const navigator = window.navigator
const document = window.document
const setTimeout = function () { return function () { } }
const setInterval = function () { }

window.requestAnimationFrame = function (res) {
    console.log("window.requestAnimationFrame ->", res)
}
window.onwheelx = {
    "_Ax": "0X21"
}
window.innerWidth = 1707
window.innerHeight = 791
window.outerWidth = 1707
window.outerHeight = 912
window.screenX = 0
window.screenY = 0
window.fetch = function (res) {
    console.log("window.fetch ->",res)
}
window.toString = function () { return "[object Window]" };

const screen = {
    availWidth: 1707,
    availHeight: 912,
    width: 1707,
    height: 960,
    colorDepth: 24,
    pixelDepth: 24,
}
module.exports= { dom, window, document, navigator, setTimeout, setInterval,screen }

